home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / mpfeel.lha / MPFeel / Modules / stop.em < prev    next >
Lisp/Scheme  |  1992-10-06  |  677b  |  43 lines

  1. ;; Eulisp Module
  2. ;; Author: pete broadbery
  3. ;; File: stop.em
  4. ;; Date: 28/jun/1991
  5. ;;
  6. ;; Project:
  7. ;; Description: 
  8. ;; function to stop processing andf then allows continuation
  9. ;;
  10.  
  11. (defmodule stop 
  12.   (standard0
  13.    list-fns
  14.    )
  15.   ()
  16.  
  17.   (defcondition Stop ())
  18.  
  19.   (deflocal *cont*)
  20.   (deflocal *vals*)
  21.   (deflocal *ignore* ())
  22.  
  23.   (defun set-ignore (x)
  24.     (setq *ignore* x))
  25.  
  26.   (defun stop (vals)
  27.     (if (not *ignore*)
  28.     (let/cc continue
  29.         (setq *cont* continue)
  30.         (setq *vals* vals)
  31.         (cerror "Stopping..." Stop 'error-value vals))
  32.       vals))
  33.        
  34.   (defun cont ()
  35.     (*cont* *vals*))
  36.   
  37.   (defun vals ()
  38.     *vals*)
  39.  
  40.   (export stop cont vals set-ignore)
  41.   ;; end module
  42.   )
  43.